<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>数组</title>
</head>
<body>

    <script>
        var arr1 = [];
        var arr2 = new Array;

        arr1.push("123");
        arr1.push(123);
        console.log(arr1);

        arr1.pop();

        arr1.splice(1,0,"kobe","james","jj");
        console.log(arr1);
        arr1.splice(0,2);
        console.log(arr1);
        arr1.splice(0,2,"haha","xixi");
        console.log(arr1);

    </script>
    
</body>
</html>